package demo03.ObserverModel;


/**
 * 观察者模式
 * 气象站类用于测试
 * */
public class WeatherStation {
	public static void main(String[] args) {
		WeatherData weatherData = new WeatherData();//建立天气对象
		CurrentConditionsDisplay currentDisplay = new CurrentConditionsDisplay(weatherData);
		StatisticsDisplay statisticsDisplay = new StatisticsDisplay(weatherData);
		ForecastDisplay forecastDisplay = new ForecastDisplay(weatherData);
		HeatIndexDisplay heatIndexDisplay = new HeatIndexDisplay(weatherData);
		//初始化数据
		weatherData.setWeatherData(80, 65, 30.4f);
		System.out.println("-------------------------------");
		weatherData.setWeatherData(82, 70, 29.2f);
		System.out.println("-------------------------------");
		weatherData.setWeatherData(78, 90, 29.2f);
	
					/*
				当前天气状态:温度80.0,湿度:65.0
				平均/最高/最低   气温 = 80.0/80.0/80.0
				天气预测: 天气正在变晴!
				人体舒适度82.95535
				-------------------------------
				当前天气状态:温度82.0,湿度:70.0
				平均/最高/最低   气温 = 81.0/82.0/80.0
				天气预测: 将要下雨了!!
				人体舒适度86.90124
				-------------------------------
				当前天气状态:温度78.0,湿度:90.0
				平均/最高/最低   气温 = 80.0/82.0/78.0
				天气预测: 天气没有好转,跟今天差不多
				人体舒适度83.64967
				*/

	}

}
